CMUD Scripting, Triggers, Macros, and Aliases
'Warning: Some triggers are more dangerous than others. Use these at your own risk.' Foremost, a disclaimer is in order. The rules of the mud state that advanced features of a player's client can be used so long as they aren't used unsupervised. As such, discussion and material on this page should stray from any content that could be used to automate play. Please restrict content to that which is not directly related to combat, work, fitness, or otherwise serves to circumvent rules or enforcement measures such as idle check. If players wish to have scripts for those items, they can read the helpfiles, and write it themselves. That having been said, scripting can be used to effectively patch problem areas in the code until such a time as they're actually fixed as well as making repetitive, time consuming tasks less so. This is probably going to seem nerdy, but it's the result of several years of reading helpfiles and headaches. Hopefully someone will find this helpful and be spared. ---- Automatic Technique Selling: Assumes you don't want to sell techniques until listed. Purpose: Gives you the ability to set what techniques you want to sell whenever you type 'tech library.' Type: Trigger Pattern: ~[([ (%d)|(%d)])~] ~*~ ~(%d)~ Script Text: $Tech=%number(%1) #if $tech=300 { #loop %2 {tech sell $Tech} } Explanation: Thist will only sell the specific techniques named instead of selling every tech other than the techniques named. List the techniques you want to always sell like "$tech=1||$tech=2||tech=3" etc. Swapping $tech=300 for that line will cause you to sell all of your techniques 1-3 whenever you type 'tech library'. If you have a lot, this could cause you to get disconnected. ---- Costs for Next Technique Rank Purpose: Display the amount of a specific technique needed for the next level of that technique when the 'technique show' command is used Type: Trigger Pattern: ~*~ ~%d|%d})~ ~*~ ~(%d~) Script Text: $Cost=0 $tech=%number(%1) #Switch (%1=0) {$cost=1} ($tech=1) {$cost=3} ($tech=2) {$cost=6} ($tech=3) {$cost=10} ($tech=4) {$cost=15} ($tech=5) {$cost=21} ($tech=6) {$cost=28} ($tech=7) {$cost=36} ($tech=8) {$cost=45} ($tech=9) {$cost=55} ($tech=10) {$cost="None"} #say Cost to level: $cost Explanation: When the trigger detects the pattern of the output from the 'technique show' command, it recognizes the current level of the technique and outputs "Cost to level: $cost" where '$cost' is a variable that stores the associated cost of each rank in the table. The final output looks something like: Tech Points: 428. [ 0] [ 1] Damage (0) Cost to level: 3 [ 1] [ 2] Damage (0) Cost to level: 6 [ 2] [ 3] Damage (0) Cost to level: 10 [ 3] [ 4] Damage (0) Cost to level: 15 [ 4] [ 5] Damage (0) Cost to level: 21 [ 5] [ 6] Damage (0) Cost to level: 28 [ 6] [ 7] Expectancy (91) Cost to level: 36 ---- Whisper To Purpose: To avoid whispering to the wrong people or mobs when you're really just trying to whisper to the room in general Type: Alias Name: Whisper Script Text: #if %1="to" {"whisper" %2 %-3} {"whisper" `x %-1} Explanation: Whenever you type whisper (and you must type the full name in order for the alias to work), it checks to see if the second word is 'to', if it is, it directs your whisper to a person. Otherwise, it whispers the entire message to the room in general with blank color code and a space in front of it. The blank color code keeps the whisper from targeting people and the space keeps the first letter from being made lowercase. Category:Triggers